package book;

/**
 * Created with IntelliJ IDEA
 * Description:图书
 * User:22954
 * Date:2024-01-12
 * Time:20:32
 */
public class Book {
    private String name;
    private String author;
    private int price;
    private String type;
    private boolean isBorrowed;

    public Book(String name, String author, int price, String type) {
        this.author = author;
        this.name = name;
        this.price = price;
        this.type = type;
    }

    public String getName() {
        return name;
    }

    @Override
    public String toString() {
        if (this.isBorrowed) {
            return "Book{" +
                    "\tname='" + name + '\'' +
                    ",\t author='" + author + '\'' +
                    ",\t price=" + price +
                    ",\t type='" + type + '\'' +
                    ",\t check out" +
                    '}';
        } else {
            return "Book{" +
                    "\tname='" + name + '\'' +
                    ",\t author='" + author + '\'' +
                    ",\t price=" + price +
                    ",\t type='" + type + '\'' +
                    ",\t available" +
                    '}';

        }
    }

    public boolean isBorrowed() {
        return isBorrowed;
    }

    public void setBorrowed(boolean borrowed) {
        isBorrowed = borrowed;
    }
}
